package com.platform.api;

import com.platform.annotation.IgnoreAuth;
import com.platform.annotation.LoginUser;
import com.platform.entity.ApiFeedbackVo;
import com.platform.entity.ApiLabelVo;
import com.platform.entity.UserVo;
import com.platform.service.ApiFeedbackService;
import com.platform.service.ApiLabelService;
import com.platform.service.ApiUserLabelService;
import com.platform.util.ApiBaseAction;
import com.platform.utils.Query;
import com.platform.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 作者: @author zhurusen <br>
 * 时间: 2017-08-11 08:32<br>
 * 描述: ApiIndexController <br>
 */
@RestController
@RequestMapping("/api/feedback")
public class ApiFeedbackController extends ApiBaseAction {

    @Autowired
    private ApiFeedbackService feedbackService;


    @RequestMapping("save")
    public R save(@LoginUser UserVo loginUser, String content) {
        ApiFeedbackVo info = new ApiFeedbackVo();

        info.setContent(content);
        info.setStatus(1);
        info.setUserId(loginUser.getId());
        info.setCreateTime(new Date());

        feedbackService.save(info);

        return R.ok(0, "提交成功", "");
    }
}